use proto_bytes::ProtoEncode2;

use super::driver::{motor, sensor};

const VERSION: u16 = 0x0C;

pub fn collect() -> impl ProtoEncode2 {
    let sen = (sensor::is_door_close() as u8) |
        ((sensor::is_door2_close() as u8) << 1) |
        ((sensor::is_pick_door_close() as u8) << 2) |
        ((sensor::is_pick_door_open() as u8) << 3) |
        ((sensor::is_straw_close() as u8) << 4) |
        ((sensor::is_cup_checked() as u8) << 5);

    let analog = motor::analog_value();

    (VERSION, (sen, analog))
}


